<template>
	<view :style="{height:PhoneInfo.windowHeight + 'px',width:PhoneInfo.windowWidth + 'px'}">
		<mvBar :mysNavConfig="mysNavConfig" @onLeftClick="onLeftClick"></mvBar>
		<u-toast ref="uToast"></u-toast>
		<view class="gross">
			<view class="eqinfo">
				<view class="eqname">{{titlename}}</view>
				<view class="eqpng">
					<u-swiper :list="point.picUrl" @click="swiperpng"></u-swiper>
				</view>
				<view class="bjinfo">
					<view class="swipertitle">报警详情</view>
					<view class="swiperneiron">
						<view class="swiperview">
							<view class="text ydone">一级报警:</view>
							<view class="number one">{{point.totalUnusual}}</view>
							<view class="text">次</view>
						</view>
						<view class="swiperview">
							<view class="text ydtwo">二级报警:</view>
							<view class="number two">{{point.totalWarning}}</view>
							<view class="text">次</view>
						</view>
						<view class="swiperview">
							<view class="text ydthree">三级报警:</view>
							<view class="number three">{{point.totalHighRisk}}</view>
							<view class="text">次</view>
						</view>
					</view>
				</view>
			</view>
			<view class="eqzt">
				<view class="dqzthead">
					<view class="dapzttitle">当前状态:
						<text
							:class="point.healthStatus==2?'one':point.healthStatus==3?'two':point.healthStatus==4?'three':'hei'">{{point.healthStatusName}}</text>
					</view>
					<view class="dapzttext">
						最后检测于:{{point.collectedTime==''?'暂无':point.collectedTime}}
					</view>
					<view v-if="point.lastAbnormalTime.length!==0"
						:class="['dapzttext',point.lastAbnormalTime[1]==2?'yvjing':point.lastAbnormalTime[1]==3?'baojing':'gaobao']">
						最近一次报警时间:{{point.lastAbnormalTime[0]}}
						<text v-if="point.lastAbnormalTime.length==3">
							{{transliteration(point.lastAbnormalTime[2])}}
						</text>
					</view>
				</view>
			</view>
			<view class="editcishu">
				<view style="width: 90%; line-height: 25px;" @click="editpoint">修改报警状态持续时间</view>
				<view style="width: 10%;">
					<u-icon name="question-circle" color="#606266" size="25" @click="editabshow=true"></u-icon>
					<u-modal :show="editabshow" title="报警状态持续时间"
						content='报警状态持续时间：该测点的报警状态将至少持续设置时间的长度，在超过设置时长并采集到正常记录时，健康状态将恢复正常（持续时间内新的报警记录将刷新持续时长）'
						@confirm='editabshow=false'></u-modal>
				</view>
			</view>
		</view>
		<view class="eqireview">
			<view class="form"><u-form labelPosition="left">
					<u-form-item label="健康状态: " label-width="75" @click="healthStatusshow = true;hideKeyboard()">
						<view>{{healthStatusName}}</view>
					</u-form-item>
					<u-picker closeOnClickOverlay :immediateChange='true' @cancel="healthStatusshow = false"
						@confirm="confirm" :show="healthStatusshow" :columns="columns" keyName="name">
					</u-picker>
				</u-form></view>
			<view class="quirehe">
				<u-checkbox-group v-model="checkboxValue" placement="column" @change="checkboxChange">
					<u-checkbox :customStyle="{marginTop: '7%'}" v-for="(item, index) in checkboxList" :key="index"
						:label="item.name" :name="item.name" :checked='false'>
					</u-checkbox>
				</u-checkbox-group>
			</view>
		</view>
		<view class="abnormallist">
			<view class="abnormalview" v-for="(item,index) in collectedRecordList" :key="item.collectRecordRealId">
				<view>
					<view class="zuo">
						<view class="eqnametime">{{item.collectedTime}}</view>
						<view class="time" @click="skipsensor(item.devicePrototypeRealId)">
							SN:{{item.devicePrototypeRealId}}</view>
					</view>
					<view class="you">
						<view class="tubiao" v-if="item.channelDatas[0].dataUrl!==''">
							<image class="boimg" src="/static/img/bo.png" mode="widthFix" @click.stop="waveform(item)">
							</image>
						</view>
						<view class="tubiao"><u-icon name="edit-pen"
								:color="item.comment!==''&&item.comment!==null&&item.comment!==undefined?'#2979ff':'#242424'"
								@click="remark(item)" size="30"></u-icon>
						</view>
					</view>
				</view>
				<view class="xia">

					<view class="xiaindex">
						<view class="biaoti">结构噪声</view>
						<view class="xiaindexlist">
							<view v-for="(constructionItem,number) in item.characteristic.construction"
								:key="constructionItem.pointFeatureCode"
								:class="['xiaview',constructionItem.healthStatus==4?'gaobao':constructionItem.healthStatus==3?'baojing':constructionItem.healthStatus==2?'yvjing':'zhengchang']"
								@click="skiptrend(constructionItem)">
								<view class="xianame">{{constructionItem.pointFeatureName}}</view>
								<view>
									{{constructionItem.value}}{{constructionItem.pointFeatureUnit=='ma'?'%':constructionItem.pointFeatureUnit}}
								</view>
							</view>
						</view>
					</view>
					<view v-if="item.characteristic.air.length!==0" class="xiaindex">
						<view class="biaoti">空气噪声</view>
						<view class="xiaindexlist">
							<view v-for="(airItem,number) in item.characteristic.air" :key="airItem.pointFeatureCode"
								:class="['xiaview',airItem.healthStatus==4?'gaobao':airItem.healthStatus==3?'baojing':airItem.healthStatus==2?'yvjing':'zhengchang']"
								@click="skiptrend(airItem)">
								<view class="xianame">{{airItem.pointFeatureName}}</view>
								<view>
									{{airItem.value}}{{airItem.pointFeatureUnit=='ma'?'%':airItem.pointFeatureUnit}}
								</view>
							</view>
						</view>
					</view>
					<view class="xiaindex">
						<view class="biaoti">振动烈度</view>
						<view class="xiaindexlist">
							<view v-for="(vibrationItem,number) in item.characteristic.vibration"
								:key="vibrationItem.pointFeatureCode"
								:class="['xiaview',vibrationItem.healthStatus==4?'gaobao':vibrationItem.healthStatus==3?'baojing':vibrationItem.healthStatus==2?'yvjing':'zhengchang']"
								@click="skiptrend(vibrationItem)">
								<view class="xianame">{{vibrationItem.pointFeatureName}}</view>
								<view>
									{{vibrationItem.value}}{{vibrationItem.pointFeatureUnit=='ma'?'%':vibrationItem.pointFeatureUnit}}
								</view>
							</view>
						</view>
					</view>
					<view v-if="item.characteristic.basics.length!==0" class="xiaindex">
						<view class="biaoti">基础信息</view>
						<view class="xiaindexlist">
							<view v-for="(basicsItem,number) in item.characteristic.basics"
								:key="basicsItem.pointFeatureCode"
								:class="['xiaview',basicsItem.healthStatus==4?'gaobao':basicsItem.healthStatus==3?'baojing':basicsItem.healthStatus==2?'yvjing':'zhengchang']"
								@click="skiptrend(basicsItem)">
								<view class="xianame">{{basicsItem.pointFeatureName}}</view>
								<view>
									{{basicsItem.value}}{{basicsItem.pointFeatureUnit=='ma'?'%':basicsItem.pointFeatureUnit}}
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<u-loadmore :status="loadStatus" :loading-text="loadingText" :loadmore-text="loadmoreText" nomore-text=" "
				bgColor="#f2f5f9"></u-loadmore>
		</view>
		<u-popup :show="remarkshow" mode="center" @close="remarkshow=false" :closeOnClickOverlay='true' :round="10"
			:safeAreaInsetBottom='false'>
			<view class="remark">
				<view class="popuptitle">添加备注</view>
				<u--textarea v-model="remarkvalue" placeholder="请输入备注" maxlength='20' :count='true'>
				</u--textarea>
				<view class="button">
					<u-button type="primary" shape='circle'
						color="linear-gradient(to right, rgb(39, 167, 225), rgb(65, 132, 234))" text="确定"
						@click="upremark"></u-button>
				</view>
			</view>
		</u-popup>
	</view>
</template>


<script>
	export default {
		data() {
			return {
				mysNavConfig: {
					/* 占位开启  */
					navPadding: true,
					/* 背景 */
					bgColor: "#2979FF",
					/* 标题 （屏幕中心居中 两边图标中心居中使用slot center1） */
					navTitle: {
						text: "测点详情",
						color: "#ffffff",
						fontSize: "18px", // px upx rpx
						fontWeight: "500", // 100 - 700
					},
					isCustomFn: true,
					btnType: "type2",
					type2Config: {
						// 左图标
						leftPath: "/static/img/back.png",
						// 右图标
						rightPath: "/static/img/home.png",
						// 圆角
						radius: "40rpx",
					}
				},
				point: {
					collectedTime: '',
					lastAbnormalTime: [],
				},
				editabshow: false,
				titlename: '',
				PhoneInfo: '',
				userinfo: '',
				parameterdataid: '',
				parameterdatatime: '',
				entrust: '',
				equipmentRealId: '',
				pointRealId: '',
				checkboxValue: [],
				checkboxList: [{
					name: '只看波形图数据',
				}, ],
				healthStatus: 0,
				healthStatusName: '全部',
				healthStatusshow: false,
				columns: [
					[{
							id: 0,
							name: '全部',
						},
						{
							id: 1,
							name: '正常',
						},
						{
							id: 2,
							name: '一级报警',
						},
						{
							id: 3,
							name: '二级报警',
						},
						{
							id: 4,
							name: '三级报警',
						}
					]
				],
				number: '',
				waveDataFlag: 0, //0表示显示全部,1表示显示波形数据
				count: '', //当前页面显示的数据条数
				collectedRecordList: [], //记录列表
				loadStatus: 'loadmore',
				loadingText: '加载中...',
				loadmoreText: '上拉加载更多',
				remarkshow: false,
				remarkid: '',
				remarkvalue: '',
			}
		},
		onLoad(parameter) {
			this.PhoneInfo = this.$utils.GetPhoneInfo();
			this.userinfo = uni.getStorageSync('userinfo');
			let parameterdata = JSON.parse(decodeURIComponent(parameter.content));
			this.equipmentRealId = parameterdata.equipmentRealId;
			this.pointRealId = parameterdata.pointRealId;
			this.titlename = parameterdata.name;
			this.number = parameterdata.number;
			this.getpointinfo(this.pointRealId);
			// 当number等于0的时候表示测点列表,1的话是报警列表
			if (parameterdata.number == 1) {
				this.parameterdataid = parameterdata.id
				this.parameterdatatime = parameterdata.time
				this.abnormal()
			} else {
				this.entrust = parameterdata.entrust;
				this.getrecordlist()
			}
		},
		methods: {
			//跳转到传感器配置页面
			skipsensor(value) {
				uni.request({
					url: getApp().globalData.serverAddress + this.$uri.Uri_querysnanduser.replace(
						"{userRealId}", this.userinfo.userRealId).replace(
						"{devicePrototypeRealId}", value),
					method: "GET",
					success: (res) => {
						if (res.statusCode !== 200) {
							this.$utils.showToast(this, '服务器错误,请联系技术支持人员!', 'error');
							return;
						}
						if (res.data.code == 0) {
							if (res.data.data) {
								uni.navigateTo({
									url: '/pages/sensor/sensor?macCode=' + value
								})
							} else {
								this.$utils.showToast(this, '该传感器已被解绑!', 'error');
							}
						} else {
							this.$utils.showToast(this, res.data.msg, 'error');
						}
					},
					fail: () => {
						this.$utils.showToast(this, '跳转失败！', 'error');
					}
				})
			},
			//返回(返回到上一级)
			onLeftClick() {
				uni.navigateBack({
					delta: 1
				});
			},
			//点击轮播图图片,进行预览
			swiperpng(index) {
				uni.previewImage({
					current: index, //预览图片的下标
					urls: this.point.picUrl //预览图片的地址，必须要数组形式，如果不是数组形式就转换成数组形式就可以
				})
			},
			//隐藏软键盘
			hideKeyboard() {
				uni.hideKeyboard()
			},
			//获取记录列表的数据
			getrecordlist() {
				uni.showLoading({
					title: "加载中...",
					mask: true,
				});
				uni.request({
					url: getApp().globalData.serverAddress + this.$uri.Uri_lookDataList.replace(
							'{userRealId}', this.userinfo.userRealId)
						.replace('{equipmentRealId}', this.equipmentRealId)
						.replace('{pointRealId}', this.pointRealId),
					data: {
						page: 1,
						limit: 10,
						endtime: this.$utils.getTime(new Date().getTime(), 0),
						healthStatus: this.healthStatus,
						waveDataFlag: this.waveDataFlag,
					},
					dataType: "json",
					method: "GET",
					success: (res) => {
						if (res.statusCode !== 200) {
							this.$utils.showToast(this, '服务器错误,请联系技术支持人员!', 'error');
							return
						}
						if (res.data.code == 0) {
							this.count = res.data.count;
							this.collectedRecordList = res.data.data;
							for (let item of this.collectedRecordList) {
								item.characteristic = {
									construction: [], //结构
									air: [], //空气
									vibration: [], //振动
									basics: [], //基础
								};
								for (let value of item.channelDatas[0].eigenDatas) {
									if (value.pointFeatureCode == 'VSX' || value.pointFeatureCode == 'VSY' ||
										value.pointFeatureCode == 'VSZ') {
										item.characteristic.vibration.push(value);
									} else if (value.pointFeatureCode == 'AUN' || value.pointFeatureCode ==
										'ADB' || value.pointFeatureCode ==
										'AFRE' || value.pointFeatureCode == 'APEAK' || value
										.pointFeatureCode == 'PDB' || value.pointFeatureCode ==
										'AWDB') {
										item.characteristic.construction.push(value);
									} else if (value.pointFeatureCode == 'AUNT' || value.pointFeatureCode ==
										'ADBT' || value.pointFeatureCode ==
										'PDBT' || value.pointFeatureCode == 'AWDBT' || value
										.pointFeatureCode == 'AFRET' || value
										.pointFeatureCode == 'APEAKT') {
										item.characteristic.air.push(value);
									} else {
										//判断如果是温度的话
										// if (value.pointFeatureCode == 'TEMP') {
										// 	//判断如果温度大于150
										// 	if (value.value >= 500) {
										// 		//将数值改为/  单位为空
										// 		value.value = "45.5";
										// 		value.pointFeatureUnit = '℃';
										// 	}
										// }
										item.characteristic.basics.push(value);
									}
								}
							}
							if (this.count < 10) {
								this.loadStatus = "nomore";
							} else {
								this.loadStatus = "loadmore";
							}
						} else {
							this.$utils.showToast(this, res.data.msg, 'error');
						}
					},
					fail() {
						this.$utils.showToast(this, "加载失败！", 'error');
					},
					complete() {
						uni.hideLoading();
					}
				})
			},
			//获取测点信息
			getpointinfo(pointRealId) {
				uni.showLoading({
					title: "加载中...",
					mask: true,
				});
				uni.request({
					url: getApp().globalData.serverAddress + this.$uri.Uri_lookPointInfo.replace("{userRealId}",
							this.userinfo.userRealId)
						.replace("{equipmentRealId}", this.equipmentRealId)
						.replace("{pointRealId}", pointRealId),
					method: "GET",
					success: (res) => {
						if (res.statusCode !== 200) {
							this.$utils.showToast(this, '服务器错误,请联系技术支持人员!', 'error');
							return
						}
						if (res.data.code == 0) {
							this.point = res.data.data;
							if (this.point.picUrl.length !== 0 && this.point.picUrl[0] !== '') {
								var arr = [];
								for (let val of this.point.picUrl) {
									arr.push(getApp().globalData.serverAddress + val)
								}
								this.point.picUrl = arr;
							} else {
								this.point.picUrl[0] = '/static/img/NoPictures.png'
							}
							//对最后一次报警时间进行分割处理
							if (this.point.lastAbnormalTime == '' || this.point.lastAbnormalTime == null ||
								this.point.lastAbnormalTime == undefined) {
								this.point.lastAbnormalTime = [];
							} else {
								this.point.lastAbnormalTime = this.point.lastAbnormalTime.split('&');
							}
						} else {
							this.$utils.showToast(this, res.data.msg, 'error');
						}
					},
					fail() {
						this.$utils.showToast(this, "加载失败！", 'error');
					},
					complete() {
						uni.hideLoading();
					}
				})
			},
			//根据文件简写,转化为文字
			transliteration(value) {
				var text = '';
				var indexunit = [{
						name: '振动烈度',
						unit: 'VSX',
					},
					{
						name: '振动烈度',
						unit: 'VSY',
					},
					{
						name: '振动烈度',
						unit: 'VSZ',
					},
					{
						name: '冲击因子',
						unit: 'AUN',
					},
					{
						name: '冲击能量',
						unit: 'ADB',
					},
					{
						name: '倾角',
						unit: 'XAN',
					},
					{
						name: '倾角',
						unit: 'YAN',
					},
					{
						name: '倾角',
						unit: 'ZAN',
					},
					{
						name: '冲击频率',
						unit: 'AFRE',
					},
					{
						name: '冲击峰值',
						unit: 'APEAK',
					},
					{
						name: '信号强度',
						unit: 'RSRP',
					},
					{
						name: '温度',
						unit: 'TEMP',
					},
					{
						name: '周期冲击能量',
						unit: 'PDB',
					},
					{
						name: '噪声分贝',
						unit: 'AWDB',
					},
					{
						name: '冲击因子(空)',
						unit: 'AUNT',
					},
					{
						name: '冲击能量(空)',
						unit: 'ADBT',
					},
					{
						name: '周期冲击能量(空)',
						unit: 'PDBT',
					},
					{
						name: '噪声分贝(空)',
						unit: 'AWDBT',
					},
					{
						name: '冲击频率(空)',
						unit: 'AFRET',
					},
					{
						name: '冲击峰值(空)',
						unit: 'APEAKT',
					},
					{
						name: '电量',
						unit: 'POWER',
					},
				];
				//for循环遍历指标数据
				for (let item of indexunit) {
					if (item.unit == 'VSX' || item.unit == 'XAN') {
						item.name = this.point.customX + item.name;
					}
					if (item.unit == 'VSY' || item.unit == 'YAN') {
						item.name = this.point.customY + item.name;
					}
					if (item.unit == 'VSZ' || item.unit == 'ZAN') {
						item.name = this.point.customZ + item.name;
					}
					//判断先吧单位转成文字
					if (item.unit == value) {
						text = item.name;
					}
				}
				return text
			},
			//健康状态
			confirm(e) {
				this.healthStatus = e.value[0].id;
				this.healthStatusName = e.value[0].name;
				this.healthStatusshow = false;
				this.getrecordlist();
			},
			//是否只查看波形数据
			checkboxChange(arr) {
				if (arr.length == 0) {
					this.waveDataFlag = 0;
				} else {
					this.waveDataFlag = 1;
				}
				this.getrecordlist();
			},
			//从报警列表进来的话,调用报警列表接口查询上下两条数据
			abnormal() {
				uni.showLoading({
					title: "加载中...",
					mask: true,
				});
				uni.request({ //显示报警记录对应的采集数据
					url: getApp().globalData.serverAddress + this.$uri.Uri_lookabnormal.replace(
							'{userRealId}', this.userinfo.userRealId)
						.replace('{equipmentRealId}', this.equipmentRealId)
						.replace('{pointRealId}', this.pointRealId),
					data: {
						collectRecordRealId: this.parameterdataid,
						collectedTime: this.parameterdatatime,
					},
					dataType: "json",
					method: "POST",
					success: (res) => {
						if (res.statusCode !== 200) {
							this.$utils.showToast(this, '服务器错误,请联系技术支持人员!', 'error');
							return
						}
						if (res.data.code == 0) {
							this.count = res.data.count;
							this.collectedRecordList = res.data.data;
							for (let item of this.collectedRecordList) {
								item.characteristic = {
									construction: [], //结构
									air: [], //空气
									vibration: [], //振动
									basics: [], //基础
								};
								for (let value of item.channelDatas[0].eigenDatas) {
									if (value.pointFeatureCode == 'VSX' || value.pointFeatureCode == 'VSY' ||
										value.pointFeatureCode == 'VSZ') {
										item.characteristic.vibration.push(value);
									} else if (value.pointFeatureCode == 'AUN' || value.pointFeatureCode ==
										'ADB' || value.pointFeatureCode ==
										'AFRE' || value.pointFeatureCode == 'APEAK' || value
										.pointFeatureCode == 'PDB' || value.pointFeatureCode ==
										'AWDB') {
										item.characteristic.construction.push(value);
									} else if (value.pointFeatureCode == 'AUNT' || value.pointFeatureCode ==
										'ADBT' || value.pointFeatureCode ==
										'PDBT' || value.pointFeatureCode == 'AWDBT' || value
										.pointFeatureCode == 'AFRET' || value
										.pointFeatureCode == 'APEAKT') {
										item.characteristic.air.push(value);
									} else {
										//判断如果是温度的话
										// if (value.pointFeatureCode == 'TEMP') {
										// 	//判断如果温度大于150
										// 	if (value.value >= 150) {
										// 		//将数值改为/  单位为空
										// 		value.value = "/";
										// 		value.pointFeatureUnit = '';
										// 	}
										// }
										item.characteristic.basics.push(value);
									}
								}
							}
							this.loadStatus = "nomore";
						} else {
							this.$utils.showToast(this, res.data.msg, 'error');
						}
					},
					fail() {
						this.$utils.showToast(this, "加载失败！", 'error');
					},
					complete() {
						uni.hideLoading();
					}
				})
			},
			//跳转趋势图
			skiptrend(value) {
				if (value.pointFeatureCode == 'XAN' || value.pointFeatureCode == 'YAN' || value.pointFeatureCode ==
					'ZAN') {
					var pointTrend = {
						pointRealId: this.pointRealId,
						equipmentRealId: this.equipmentRealId,
						nametitle: this.titlename,
						entrust: this.entrust,
						time: value.collectedTime,
					}
					var timedatas = new Date(value.collectedTime.replace(/-/g, '/')).getTime() + 259200000;
					if (timedatas > new Date(this.collectedRecordList[0].collectedTime.replace(/-/g, '/')).getTime()) {
						pointTrend.time = this.collectedRecordList[0].collectedTime;
					} else {
						pointTrend.time = this.$utils.getTime(timedatas, 0);
					}
					this.$store.commit('alterpointTrend', pointTrend);
					uni.navigateTo({
						url: '/pages/equipment/pointTrend?id=40'
					})
				} else {
					var pointTrend = {
						pointRealId: this.pointRealId,
						equipmentRealId: this.equipmentRealId,
						nametitle: this.titlename,
						entrust: this.entrust,
						time: value.collectedTime,
						indexid: value.pointFeatureRealId,
					}
					var timedatas = new Date(value.collectedTime.replace(/-/g, '/')).getTime() + 259200000;
					if (timedatas > new Date(this.collectedRecordList[0].collectedTime.replace(/-/g, '/')).getTime()) {
						pointTrend.time = this.collectedRecordList[0].collectedTime;
					} else {
						pointTrend.time = this.$utils.getTime(timedatas, 0);
					}
					this.$store.commit('alterpointTrend', pointTrend);
					uni.navigateTo({
						url: '/pages/equipment/pointTrend?id=3'
					})
				}
			},
			//跳转到波形数据趋势图中
			waveform(value) {
				var wavedata = {
					pointRealId: this.pointRealId,
					equipmentRealId: this.equipmentRealId,
					channelDataRealId: value.channelDatas[0].channelDataRealId,
					collectedTime: value.collectedTime,
					name: this.titlename,
					graphType: 1,
					dataType: 1,
					starttime: '',
					endtime: '',
				}
				this.$store.commit('alterwaveform', wavedata);
				uni.navigateTo({
					url: '/pages/equipment/waveform'
				})
			},
			//修改报警状态持续时间
			editpoint() {
				let parameterinfo = {
					pointRealId: this.pointRealId,
					equipmentRealId: this.equipmentRealId,
					entrust: this.entrust,
				}
				let parameterinfodata = JSON.stringify(parameterinfo);
				uni.navigateTo({
					url: `/pages/equipmentManage/editPoint?content=${encodeURIComponent(parameterinfodata)}`
				})
			},
			//显示弹窗
			remark(value) {
				this.remarkvalue = '';
				if (value.comment !== '' && value.comment !== null && value.comment !== undefined) {
					this.remarkvalue = value.comment;
				}
				this.remarkshow = true;
				this.remarkid = value.collectRecordRealId;
			},
			//修改备注
			upremark() {
				this.remarkshow = false
				let remarkinfo = new Object();
				remarkinfo.collectRecordRealId = this.remarkid;
				remarkinfo.comment = this.remarkvalue;
				uni.showLoading({
					title: "修改中...",
					mask: true,
				});
				uni.request({
					url: getApp().globalData.serverAddress + this.$uri.Uri_addRemark.replace(
						"{userRealId}", this.userinfo.userRealId).replace(
						"{equipmentRealId}", this.equipmentRealId).replace(
						"{pointRealId}", this.pointRealId),
					data: JSON.stringify(remarkinfo),
					dataType: "json",
					method: "POST",
					success: (res) => {
						if (res.statusCode !== 200) {
							this.$utils.showToast(this, '服务器错误,请联系技术支持人员!', 'error');
							return
						}
						if (res.data.code == 0) {
							this.$utils.showToast(this, '修改成功！', 'success');
							//添加成功以后,循环遍历数据列表将备注添加上
							for (let item of this.collectedRecordList) {
								if (item.collectRecordRealId == this.remarkid) {
									item.comment = this.remarkvalue;
								}
							}
						} else {
							this.$utils.showToast(this, res.data.msg, 'error');
						}
					},
					fail: () => {
						this.$utils.showToast(this, '修改失败！', 'error');
					},
					complete: () => {
						uni.hideLoading();
					}
				})
			},
		},
		//下拉加载
		onReachBottom() {
			if (this.number == 1) {
				return;
			}
			if (this.count < 10) {
				this.loadStatus = "nomore";
				return;
			} else {
				this.loadStatus = "loading";
			}
			setTimeout(() => {
				uni.request({
					url: getApp().globalData.serverAddress + this.$uri.Uri_lookDataList.replace(
							'{userRealId}', this.userinfo.userRealId)
						.replace('{equipmentRealId}', this.equipmentRealId)
						.replace('{pointRealId}', this.pointRealId),
					data: {
						page: 1,
						limit: 10,
						endtime: this.collectedRecordList[this.collectedRecordList.length - 1]
							.collectedTime,
						healthStatus: this.healthStatus,
						waveDataFlag: this.waveDataFlag,
					},
					dataType: "json",
					method: "GET",
					success: (res) => {
						if (res.statusCode !== 200) {
							this.$utils.showToast(this, '服务器错误,请联系技术支持人员!', 'error');
							return
						}
						if (res.data.code == 0) {
							this.count = res.data.count;
							for (let item of res.data.data) {
								item.characteristic = {
									construction: [], //结构
									air: [], //空气
									vibration: [], //振动
									basics: [], //基础
								};
								for (let value of item.channelDatas[0].eigenDatas) {
									if (value.pointFeatureCode == 'VSX' || value.pointFeatureCode ==
										'VSY' ||
										value.pointFeatureCode == 'VSZ') {
										item.characteristic.vibration.push(value);
									} else if (value.pointFeatureCode == 'AUN' || value
										.pointFeatureCode ==
										'ADB' || value.pointFeatureCode ==
										'AFRE' || value.pointFeatureCode == 'APEAK' || value
										.pointFeatureCode == 'PDB' || value.pointFeatureCode ==
										'AWDB') {
										item.characteristic.construction.push(value);
									} else if (value.pointFeatureCode == 'AUNT' || value
										.pointFeatureCode ==
										'ADBT' || value.pointFeatureCode ==
										'PDBT' || value.pointFeatureCode == 'AWDBT' || value
										.pointFeatureCode == 'AFRET' || value
										.pointFeatureCode == 'APEAKT') {
										item.characteristic.air.push(value);
									} else {
										//判断如果是温度的话
										// if (value.pointFeatureCode == 'TEMP') {
										// 	//判断如果温度大于150
										// 	if (value.value >= 150) {
										// 		//将数值改为/  单位为空
										// 		value.value = "/";
										// 		value.pointFeatureUnit = '';
										// 	}
										// }
										item.characteristic.basics.push(value);
									}
								}
								this.collectedRecordList.push(item)
							}
							if (this.count < 10) {
								this.loadStatus = "nomore";
							} else {
								this.loadStatus = "loadmore";
							}
						} else {
							this.$utils.showToast(this, res.data.msg, 'error');
						}
					},
					fail() {
						this.$utils.showToast(this, "加载失败！", 'error');
					}
				})
			}, 1000);
		},
		//下拉刷新
		onPullDownRefresh() {
			if (this.number !== 1) {
				this.getrecordlist()
			}
			uni.stopPullDownRefresh();
		}
	}
</script>

<style lang="scss" scoped>
	//渐变背景
	.gross {
		background-image: linear-gradient(to bottom, rgb(41, 121, 255), rgb(246, 246, 246));
	}

	//设备信息
	.eqinfo {
		width: 90%;
		margin: auto;
		height: 60%;
		padding: 2%;
		border-radius: 15px;
		background-color: #fff;
		position: relative;
	}

	//设备名称
	.eqname {
		width: 90%;
		word-wrap: break-word;
		font-size: 16px;
		font-weight: bold;
		margin: 3% auto;
		text-align: center;
		color: #2979ff;
	}

	//设备轮播图
	.eqpng {
		display: inline-block;
		width: 44%;
		margin: 0% 3%;
	}

	//报警信息
	.bjinfo {
		display: inline-block;
		width: 50%;
		position: absolute;
	}

	//轮播图-右侧标题
	.swipertitle {
		font-size: 18px;
		font-weight: 600;
		text-align: center;
		margin-bottom: 5%;
	}

	//标题下数据
	.swiperneiron {
		display: flex;
		flex-direction: column;
	}

	//每一行数据
	.swiperview {
		flex-grow: 1;
		text-align: center;
		margin: 3% 0%;
	}

	//name和单位
	.text {
		display: inline-block;
		font-size: 14px;
		font-weight: bold;
		color: #303133;
		flex-grow: 1;
		text-align: center;
	}

	//数字
	.number {
		width: 25%;
		display: inline-block;
		font-size: 16px;
		font-weight: 700;
		flex-grow: 1;
		text-align: center;
	}

	//数据字体颜色和伪类
	.hei {
		color: #303133;
	}

	.one {
		//一级报警
		color: #ebbb53;
	}

	.two {
		//二级报警
		color: #FC8452;
	}

	.three {
		//三级报警
		color: #EE6666;
	}

	.ydone {
		&::before {
			content: '';
			display: inline-block;
			width: 7px;
			height: 7px;
			background: #ebbb53;
			border-radius: 50%;
			margin-right: 6px;
			margin-bottom: 2px;
		}
	}

	.ydtwo {
		&::before {
			content: '';
			display: inline-block;
			width: 7px;
			height: 7px;
			background: #FC8452;
			border-radius: 50%;
			margin-right: 6px;
			margin-bottom: 2px;
		}
	}

	.ydthree {
		&::before {
			content: '';
			display: inline-block;
			width: 7px;
			height: 7px;
			background: #EE6666;
			border-radius: 50%;
			margin-right: 6px;
			margin-bottom: 2px;
		}
	}

	//设备当前状态
	.eqzt {
		width: 90%;
		margin: 3% auto;
		padding: 2% 5%;
		background-color: #ffffff;
		border: 1px solid #ebeef5;
		border-radius: 15px;
		display: flex;
	}

	//list内容
	.dqzthead {
		width: 100%;
		word-wrap: break-word;
	}

	//当前状态
	.dapzttitle {
		font-size: 15px;
		line-height: 22px;
		color: #303133;
	}

	//最后检测时间
	.dapzttext {
		margin-top: 5rpx;
		font-size: 12px;
		line-height: 18px;
		color: #303133;
	}

	//报警次数阈值
	.editcishu {
		font-size: 15px;
		width: 90%;
		margin: 3% auto;
		padding: 2% 5%;
		background-color: #ffffff;
		border: 1px solid #ebeef5;
		border-radius: 10px;
		word-wrap: break-word;
		display: flex;
	}

	.eqireview {
		width: 90%;
		margin: auto;
		display: flex;
		margin-top: -2%;
	}

	.form {
		width: 50%;
		flex-grow: 1;
		margin-left: 7%;
	}

	.quirehe {
		width: 50%;
		flex-grow: 1;
	}

	.abnormallist {
		width: 90%;
		margin: -2% 5% 0% 5%;
	}

	.abnormalview {
		border: 1px solid #cdcdce;
		border-radius: 15rpx;
		margin: 3% 0%;
		padding: 3%
	}

	.zuo {
		display: inline-block;
		width: 70%;
		word-wrap: break-word;
		padding-left: 2%;
	}

	.eqnametime {
		font-size: 16px;
		color: #262c36;
		font-weight: bold;
	}

	.time {
		font-size: 13px;
		color: #777777;
		margin: 3% 0%;
		font-weight: bold;
	}

	.you {
		position: relative;
		padding: 1%;
		top: -20rpx;
		display: inline-block;
		width: 30%;
		word-wrap: break-word;
	}

	.tubiao {
		display: inline-block;
		margin-left: 10%;
	}

	.boimg {
		width: 60rpx;
		height: 60rpx;
		position: relative;
		top: 10rpx;
	}

	.xia {
		padding-top: 3%;
		flex-wrap: wrap;
	}

	.xiaview {
		text-align: center;
		font-size: 12px;
		display: inline-block;
		border: 1px dashed #b0b2b5;
		flex-grow: 1;
		width: 33%;
		padding: 3% 0%;
	}

	.xianame {
		padding-bottom: 5%;
	}

	.zhengchang {
		color: #262c36;
	}

	.yvjing {
		color: #ebbb53;
	}

	.baojing {
		color: #FC8452;
	}

	.gaobao {
		color: #EE6666;
	}

	.popuptitle {
		width: 100%;
		margin: 0px auto 20rpx;
		text-align: center;
		font-size: 20px;
		font-weight: bold;
	}

	.remark {
		padding: 40rpx;
		width: 600rpx;
	}

	.button {
		width: 90%;
		margin: 5% auto;
	}

	.biaoti {
		width: 100%;
		padding: 2% 0%;
		text-align: center;
		font-size: 16px;
		font-weight: bold;
		border: 1px dashed #b0b2b5;
	}

	.xiaindex {
		margin-bottom: 5%;
	}

	.xiaindexlist {
		display: flex;
		flex-wrap: wrap;
	}
</style>